<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>情况一 - margin塌陷的问题</title>
  <style>
    /* 情况一: 子元素设置 上外边距 后, 生效的却是给到了父元素 */
    .father {
      width: 300px;
      height: 300px;
      background-color: pink;

      /* 解决 */
      overflow: hidden;
    }

    .son {
      width: 150px;
      height: 150px;
      background-color: orange;
      margin-top: 50px;
    }
  </style>
</head>

<body>
  <div class="father">
    <div class="son"></div>
  </div>
</body>

</html>